<!--
 * @FilePath     : /study_code/layui/8-3-2.html
 * @Description  : 同步写法：latpl().render() 返回的 str 是渲染好的值。
 * @Date         : 2025-04-09 09:33:26
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-09 09:37:23
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <div id="container"></div>

    <script src="/layui/dist/layui.js"></script>
    <script>
      layui.use(['laytpl', 'jquery'], function () {
        var laytpl = layui.laytpl,
          $ = layui.$

        var str = laytpl('{{= d.name }}是一名前端工程师').render({
          name: '李四',
        })
        console.log('模板引擎函数返回内容?', str)
        $('#container').append(str)
      })
    </script>
  </body>
</html>
